1. Field of the Invention
The present invention relates to a coding device, coding method, transmission device, transmission method and recording medium and more particularly relates to a coding device, coding method, transmission device, transmission method and recording medium for coding a plurality of data at different bit rates.
2. Description of the Related Art
FIG. 1 is a block diagram showing an example configuration of a device for coding and then decoding a plurality of data after transmission or recording. In FIG. 1, a coding device 130 codes a plurality of data and then outputs this data. Further, a decoding device 131 then decodes the data coded by the coding device 130 to the original data and then outputs this data.
Video data 100, audio data 101 and other data 102 of the coding device 130 is coded by a video coder 103, audio coder 104 and another coder 105 before being outputted to a multiplexer 109 as elementary streams 106 to 108.
The video coder 103 codes and outputs the video data 100 based on the standards (so-called MPEG (Moving Picture Experts Group) method) shown in, for example, ISO (International Organization for Standardization) 13818-2 and ISO11172-2. Further, the audio coder 104 codes and outputs the audio data 101 based on the standards (MPEG method) shown in ISO13818-3 and ISO11172-3.
The multiplexer 109 time-multiplexes the elementary streams 106 to 108 and outputs a multiplexed bit stream 110 comprising a single string bit stream. This multiplexed bit stream 110 is recorded on a recording medium 111 or transmitted via a transmission path 112 so as to be inputted to a decoding device 131.
At the multiplexer 109, synchronization information not shown in the drawings for this data is also added to the multiplexed bit stream 110 as side information in order to obtain synchronization with the video data 100 and the audio data 101 on the decoding side while the data is being multiplexed.
At a separator 113 of the decoding device 131, the elementary streams 106 to 108 are separated from the multiplexed bit stream 110 and supplied to a video decoder 117, audio decoder 118 and another decoder 119.
The video decoder 117, audio decoder 118 and the other decoder 119 decode the coded data back to the original data and output this data as video data 120, audio data 121 and other data 22. Synchronization is then secured because the video data 120 and the audio data 121 is synchronized and then decoded by the video decoder 117 and the audio decoder 118 so as to correspond with the aforementioned synchronization information.
In the above example an example is shown where programs included for each of the items of video data 100, audio data 101 and other data 102 are multiplexed. With regards to this, an example for the case where a plurality of programs comprising a plurality of data is multiplexed is shown in the following.
FIG. 2 is a block view showing an example configuration of a device for multiplexing, transmitting and recording a plurality of programs comprising a plurality of data. The multiplexing of this kind of plurality of programs is carried out based on, for example, transport stream multiplexing (Transport Stream Multiplexing) standardized in, for example, ISO13818-1 and 11172-1.
In FIG. 2, a coding device 230 outputs a plurality of programs after coding and multiplexing. The decoding device 231 decodes the original data from data coded at the coding device 230.
The programs 200-1 to 200-n of the coding device 230 comprises video data 200-1a to 200-na and audio data 200-1b to 200-nb. The video data 200-1a to 200-na is inputted to video coders 201V-1 to 201V-n, respectively. Further, the audio data 200-1b to 200-nb is inputted to audio coders 201A-1 to 201A-n, respectively. The video coders 201V-1 to 201V-n and the audio coders 201A-1 to 201A-n code in such a manner that items of inputted data become of pre-allotted bit rates to be outputted as a video elementary stream and an audio elementary stream.
The video data 200-1a to 200-na and the audio data 200-1b to 200-nb multiplexed by the video coders 201V-1 to 201V-n and the audio coders 201A-1 to 201A-n is inputted to the multiplexer 209 and multiplexed.
The signal multiplexed by the multiplexer 209 is transmitted by the transfer medium 210A or recorded on the recording medium 210B.
A separator 211 of the decoding device 231 reads a time-multiplexed stream from the transfer medium 210A (or the recording medium 210B), separates and extracts the video elementary stream and the audio and the audio elementary stream from this stream and supplies these streams to video decoders 212V-1 to 212V-n and audio decoders 212A-1 to 212A-n. The video decoders 212V-1 to 212V-n and the audio decoders 212A-1 to 212A-n decode the coded streams and output the original data. Programs 218-1 to 218-n comprised of video data 218-1a to 218-na and audio data 218-1b to 218-nb can then be obtained as a result.
These programs 218-1 to 218-n are then outputted to the respective corresponding display devices. Information sent from the coding side can therefore be utilized as a result.
In the example shown in FIG. 2, the case where all of the elementary streams are read is shown but decoding by selecting arbitrary elementary streams is also possible.
In the above example, when, for example, a plurality of streams are transmitted by the transfer medium 210A, as shown in FIG. 3, a fixed bit rate is allotted to each elementary stream. In this kind of method, the signal quality falls when the degree of difficulty of coding the target signal is high (when a large amount of information is coded at the coder). Further, coded data becomes redundant when the degree of difficulty of coding becomes low (when the amount of information coded at the coder is small) with the bit stream being used more than is necessary as a result.
As shown in FIG. 4, a method is provided where each of the elementary streams are transmitted (or recorded) at variable bit rates. In this example, the widths of the respective graphs (corresponding to the bit rate) change in response to changes in the degree of difficulty of coding the data because the bit rate is allotted to each of the bit streams in response to the amount of information for this data (a high bit rate is allotted when there is a large amount of information).
An example of a configuration for a coding device for realizing this kind of transmission method is shown in FIG. 5.
In FIG. 5, portions corresponding to portions in FIG. 2 are given the same numerals and the description is omitted as appropriate.
In this example, the video data 200-1a to 200-na is inputted to video coders 306V-1 to 306V-n via rate measurers necessary for video 300v-1 to 300V-n and the audio data 200-1b to 200-nb is inputted to audio coders 306A-1 to 306A-n via rate measurers necessary for audio 300A-1 to 300A-n.
The rate measurers necessary for video 300V-1 to 300V-n and the rate measurers necessary for audio 300A-1 to 300A-n measures the rate (necessary rate) necessary during coding of the video data 200-1a to 200-na and the audio data 200-1b to 200-nb using the tonality etc. showing undulations in the spectral distribution of the input signal. The coding rates of the video coders 306V-1 to 306V-n and the audio coders 306A-1 to 306A-n are then controlled independently based on the measured data.
At this time, it is necessary to ensure that the total for the bit rates for all of the data does not exceed the maximum bit rate for the transfer medium 210A. The maximum bit rate is then allotted to each of the items of data and coding is then carried out so that this maximum bit rate is not exceeded. In this way, the total for the maximum bit rate allotted to each item of data becomes larger than the maximum bit rate of the transmission path but practical problems are few because the probability of a large number of data items of a high degree of coding difficulty occurring at the same time is small.
The video coders 306V-1 to 306V-n and the audio coders 306A-1 to 306A-n code the video data 200-1a to 200-na and the audio data 200-1b to 200-nb at a prescribed bit rate based on the control of the rate measurers necessary for video 300V-1 to 300V-n and the rate measurers necessary for audio 300A-1 to 300A-n. The coded items of data and the coded rate information are supplied to the multiplexer 312, time coded based on each item of coding rate information and outputted to the transfer medium 210A (or the recording medium 210B).
In this example, there is little noticeable deterioration or redundant consumption of the stream because the bit rates are allotted in response to the amount of information for each elementary stream.
However, in the aforementioned example, coding is carried out at each of the coders independently. It is therefore possible that the coded data will exceed the maximum bit rate for the transfer medium 210A when a number of items of data for which the degree of difficulty of coding is very high occur, even though the probability of this is low.
In order to prevent this, making the aforementioned maximum bit rate value allotted to each of the items of data small has been considered. However, if the maximum bit rate is made small, the quality of data for which a bit rate which exceeds this maximum bit rate is necessary falls.
On the other hand, the multiplexing rate for the multiplexed data becomes extremely small with respect to the maximum bit rate of the transfer medium 210A when a large amount of data for which the degree of difficulty of coding is extremely low appears so that coding can be carried out at each of the coders independently. In this case, the transfer capability of the transfer medium is not used to it's maximum limit and redundancy therefore occurs.
In order to resolve the aforementioned situation, the present invention is such that the bit rate for each item of data does not exceed the maximum bit rate of the transfer medium 210A or the recording medium 210B when a plurality of data is transmitted or recorded and the allotting of the most appropriate bit rates to each item of data is possible.